@import 'mixins.scss';

/* table
 -------------------- */
.table-wrap {
  padding: 20px 20px 0;
}

/* table
 -------------------- */
.ym-table {
  --color-edit: #2684ff; // 编辑颜色
  --color-del: #ff2626; // 删除颜色
  &.el-table {
    height: 100%;
    min-height: 130px;
    color: var(--table-color);
    background: var(--table-background);
    border-radius: 6px 6px 0 0;

    &::before {
      background: transparent;
    }

    thead {
      color: var(--table-color);
    }

    th,
    td {
      padding: 10px 0;
      font-size: 14px;
    }

    th {
      font-size: 16px;
      // background: var(--table-background-striped);
      border-bottom: 1px solid var(--table-border);

      // &.is-leaf {
      //   border: none;
      // }

      // &:last-child {
      //   border-radius: 0 6px 6px 0;
      // }
    }

    tr {
      position: relative;
      background: var(--table-background);
      background: transparent;
      border-radius: 6px;

      &.is-returned {
        &::after {
          position: absolute;
          left: 0;
          z-index: 20;
          width: 38px;
          height: 14px;
          font-size: 11px;
          color: #6f590d;
          text-align: center;
          vertical-align: middle;
          background: #ffd239;
          border: 1px solid #ffe99d;
          border-radius: 6px 0 6px 0;
          content: '退回';
          box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
        }
      }

      &.hover-row,
      &.current-row,
      &:hover {
        td {
          background: var(--table-background);
        }
      }

      // &.current-row td {
      //   background: rgba(196, 196, 196, 1);
      //   // background: rgba(196, 196, 196, 0.35);
      //   border-color: rgba(189, 189, 189, 0.2);
      // }

      &.current-row td {
        // z-index: 10;
        border-top: 1px solid var(--color-primary);
        border-bottom: 1px solid var(--color-primary);

        &:first-child {
          position: relative;
          border-radius: 5px 0 0 5px;

          &::before {
            position: absolute;
            top: -1px;
            bottom: 0;
            left: 0;
            width: 5px;
            background: var(--color-primary);
            border-radius: 6px 0 0 6px;
            content: '';
          }
        }

        &:last-child {
          border-right: 1px solid var(--color-primary);
        }
      }
    }

    td {
      background: var(--table-background);
      border: none;
      border-top: 1px solid transparent;
      // border-bottom: 1px solid transparent;
      border-bottom: 1px solid var(--table-border);

      &:first-child {
        position: relative;
        // border-radius: 6px 0 0 6px;
      }

      &:last-child {
        // border-radius: 0 6px 6px 0;
      }
    }

    .el-table {
      &__fixed,
      &__fixed-right {
        &::before {
          background: transparent;
        }
      }

      &__fixed-right {
        height: calc(100% - 9px) !important;
      }

      &--scrollable-y {
        .el-table__fixed-right {
          right: var(--scrollbar-width) !important;
        }
      }

      &__fixed-right-patch {
        width: var(--scrollbar-width) !important;
        // background: var(--table-background-striped);
        background: transparent;
        border: none;
        border-color: var(--table-background-striped);
        border-radius: 0 6px 6px 0;
      }

      &__header-wrapper,
      &__fixed-header-wrapper {
        border: none;
        border-radius: 6px;
      }

      &__body-wrapper,
      &___fixed-body-wrapper {
        min-height: 94px !important;
        @include scroll-bar();
      }

      &__empty-block {
        // height: 94px !important;
        // 为了解决问题 覆盖右边固定操作
        position: relative;
        // z-index: 10;
      }

      // &__row {
      //   &.current-row.hover-row,
      //   &--striped.current-row,
      //   &:hover {
      //     td {
      //       background: transparent !important;
      //     }
      //   }
      // }
    }

    &--striped {
      .el-table__body {
        tr {
          &.el-table__row {
            &--striped {
              // background: var(--table-background-striped);

              td {
                background: var(--table-background-striped);
              }
            }
          }
        }
      }
    }
  }

  .btn-edit {
    color: var(--color-edit);
  }

  .btn-del {
    color: var(--color-del);
  }

  &.no-selected.el-table {
    tr {
      &.current-row td {
        // z-index: 10;
        border-top: 1px solid transparent;
        border-bottom: 1px solid var(--table-border);

        &:first-child {
          position: relative;
          border-radius: 5px 0 0 5px;

          &::before {
            display: none;
          }
        }

        &:last-child {
          border: none;
        }
      }
    }
  }
}
